package org.nvframe.component.render;

import org.nvframe.component.AbstractComponent;
import org.nvframe.entity.Entity;
import org.nvframe.manager.RenderManager;
import org.nvframe.util.Settings;

/**
 * 
 * @author Nik Van Looy
 */
public abstract class AbstractRender extends AbstractComponent {
	
	private final int priority;

	public AbstractRender(String id, Entity owner, Settings settings) {
		super(id, owner);
		
		priority = settings.getInt("z-index", 1);
		
		RenderManager.getInstance().addComponent(this, priority);
	}

	@Override
	public void removed(Entity entity) {
		RenderManager.getInstance().removeComponent(this, priority);
	}
}